﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysRole")]
    public class SysRole : BaseEntity
    {
        public enum EnumRoleStatus
        { 启用 = 0, 禁用 = 1 }

        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid RoleId { get; set; }

        [Required]
        [Column(TypeName = "varchar(50)")]
        public string Name { get; set; }

        [Required]
        [Column(TypeName = "varchar(50)")]
        public string Code { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string Description { get; set; }

        [Required]
        [Column(TypeName = "int")]
        public EnumRoleStatus? Status { get; set; }

        [Required]
        [Column(TypeName = "bool")]
        public bool IsSuperAdministrator { get; set; }

        [Column(TypeName = "bool")]
        public bool Builtin { get; set; }

        public virtual ICollection<SysUserRole> SysUserRoles { get; set; }
        public virtual ICollection<SysRolePermission> SysRolePermissions { get; set; }
    }
}